import prompt from '@system.prompt';
// index.js
import router from '@system.router';

export default {
    data:{
      search_value:"",
        index:2,
        text:'',
      image_array:["/common/temp/class1.jpg","/common/temp/class2.jpg","/common/temp/class3.jpg","/common/temp/class4.jpg"],
        classes:[
            {"name":"数学课","teacher":"夏德旺","persons":77,"imgSrc":"/common/temp/class1.jpg"},
            {"name":"英语课","teacher":"张三","persons":77,"imgSrc":"/common/temp/class2.jpg"},
            {"name":"物理课","teacher":"李四","persons":77,"imgSrc":"/common/temp/class3.jpg"},
            {"name":"计算机课","teacher":"王五","persons":77,"imgSrc":"/common/temp/class4.jpg"},
            {"name":"计算机课","teacher":"王五","persons":77,"imgSrc":"/common/temp/class4.jpg"},
            {"name":"计算机课","teacher":"王五","persons":77,"imgSrc":"/common/temp/class4.jpg"}

        ],
        myData:[
            {imgSrc:"/common/icon/home.png",title:"首页",imgSrcActive:"/common/icon/home-active.png"},
            {imgSrc:"/common/icon/study.png",title:"学习",imgSrcActive:"/common/icon/study-active.png"},
            {imgSrc:"/common/icon/message.png",title:"消息",imgSrcActive:"/common/icon/message-active.png"},
            {imgSrc:"/common/icon/my.png",title:"我的",imgSrcActive:"/common/icon/my-active.png"}
        ],

//        menuData:[
//            {imgSrc:"/common/icon/home.png",title:"首页",imgSrcActive:"/common/icon/home-active.png"},
//            {imgSrc:"/common/icon/study.png",title:"学习",imgSrcActive:"/common/icon/study-active.png"},
//            {imgSrc:"/common/icon/message.png",title:"消息",imgSrcActive:"/common/icon/message-active.png"},
//            {imgSrc:"/common/icon/my.png",title:"我的",imgSrcActive:"/common/icon/my-active.png"}
//        ],
//        defaultIndex:0
    },
//    change_bar(value){
//        this.defaultIndex=value
//    },
    launch() {
        router.push ({

            uri:'pages/details/details', // 指定要跳转的页面
        })
    },
    textClicked (e) {
        this.text = e.detail.text;
    },

    change_search(event){
      this.search_value=event.value
      console.log("search_value")
      prompt.showToast({
          message:"搜索内容"+this.search_value
      })
    },
    changeBanner(){
        this.$element("banner").swipeTo({index:2})
    },
//    通过事迹实现假的双向绑定
    change(envet) {
        this.title = envet.value
        console.log(this.title)
    },

}